package com.gitee.feizns.zxw.service.backstage.impl;

import com.gitee.feizns.zxw.service.backstage.ThemeTourismTravelLineRecommendFoodService;

import com.gitee.feizns.web.domain.page.PageAo;
import com.gitee.feizns.web.domain.page.PageVoRet;

import com.gitee.feizns.zxw.domain.backstage.ao.theme.tourism.travel.line.recommend.food.ListAo;
import com.gitee.feizns.zxw.domain.backstage.ao.theme.tourism.travel.line.recommend.food.CreateAo;
import com.gitee.feizns.zxw.domain.backstage.ao.theme.tourism.travel.line.recommend.food.UpdateAo;
import com.gitee.feizns.zxw.domain.backstage.vo.theme.tourism.travel.line.recommend.food.ListVo;
import com.gitee.feizns.zxw.domain.backstage.vo.theme.tourism.travel.line.recommend.food.DetailsVo;

import com.gitee.feizns.zxw.domain.pojo.ThemeTourismTravelLineRecommendFood;
import org.springframework.stereotype.Service;

/**
 * @author feizns
 * @since 2019/09/09
 */
@Service
public class ThemeTourismTravelLineRecommendFoodServiceImpl implements ThemeTourismTravelLineRecommendFoodService {

    /**
     * 列表
     * @param page
     * @param ao
     */
    @Override
    public PageVoRet<ListVo> list(PageAo page, ListAo ao) {
        return new ThemeTourismTravelLineRecommendFood().selectPage(ListVo.class, page, ao);
    }

    /**
     * 详情
     * @param id
     */
    @Override
    public DetailsVo details(Integer id) {
        return new ThemeTourismTravelLineRecommendFood().selectByPk(DetailsVo.class, id);
    }

    /**
     * 创建
     * @param ao
     */
    @Override
    public DetailsVo create(CreateAo ao) {
        return details((Integer) ao.to(ThemeTourismTravelLineRecommendFood.class).create());
    }

    /**
     * 修改
     * @param id
     * @param ao
     */
    @Override
    public DetailsVo update(Integer id, UpdateAo ao) {
        return details((Integer) ao.to(ThemeTourismTravelLineRecommendFood.class).updateByPk(id));
    }

    /**
     * 删除
     * @param id
     */
    @Override
    public void delete(Integer id) {
        new ThemeTourismTravelLineRecommendFood().deleteById(id);
    }

}

